package com.sunrise.xdoc.entity.operator;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.sunrise.xdoc.entity.AbstractIdEntity;
import com.sunrise.xdoc.entity.user.User;

/**
 * 1 user -> n operators. Each operator presents a position in an organization.
 * *
 * 
 */
@Entity
@Table(name = "op_operator")
@Inheritance(strategy = InheritanceType.JOINED)
public class Operator extends AbstractIdEntity implements Serializable {
	private static final long serialVersionUID = 1L;
	private User user;

	@ManyToOne
	@JoinColumn(name = "user_id", nullable = false)
	@NotNull
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}
